#include <iostream>

struct Parent
{
  Parent(std::size_t pv)
    : parent_val(pv)
  { }

  std::size_t parent_val;
};


std::ostream&
operator<< (std::ostream& os, const Parent& p)
{
  os << "[" << p.parent_val << "]" << std::endl;
  return os;
}

struct Child : public  Parent
{
  Child(std::size_t pv, std::size_t cv)
    : Parent(pv), child_val(cv)
  { }

  std::size_t child_val;
};

std::ostream&
operator<< (std::ostream& os, const Child& c)
{
  os << (Parent)c;
  os << "(" << c.child_val << ")" << std::endl;
  return os;
}

int main()
{
  Child c(1, 2);

  std::cout << c;
}
